﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MainScene;

namespace SSShell
{
    public partial class registration : Form
    {
        frmMain formMain;


        public registration(frmMain _formMain)
        {
            InitializeComponent();
            formMain = _formMain;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (loginBox.Text == "")
            {
                MessageBox.Show("Не задан логин", "Ошибка",
                            MessageBoxButtons.OK, MessageBoxIcon.Error);
                loginBox.Focus();
                return;
            }
            if (passwordBox.Text == "")
            {
                MessageBox.Show("Не задан пароль", "Ошибка",
                            MessageBoxButtons.OK, MessageBoxIcon.Error);
                passwordBox.Focus();
                return;
            }
            formMain.login = loginBox.Text;
            formMain.password = passwordBox.Text;
            this.Close();
        }
    }
}
